package com.yty.demo._4_oop;

/**
 * @author: yangtaoyao
 * @time: 2020/1/6$ 14:35$
 * @description:
 */
public class BirthDate {
    private int day;
    private int month;
    private int year;

    public BirthDate(int day, int month, int year) {
        this.day = day;
        this.month = month;
        this.year = year;
    }

    public BirthDate() {

    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    @Override
    public String toString() {
        return "BirthDate{" +
                "day=" + day +
                ", month=" + month +
                ", year=" + year +
                '}';
    }

    public static void change1(BirthDate birthDate){
        birthDate=new BirthDate(22,2,2020);
    }

    public static void change2(BirthDate birthDate){
        birthDate.day=2;
    }

    public static void main(String[] args) {
        BirthDate birthDate=new BirthDate(6,1,2020);
        change1(birthDate);
        System.out.println(birthDate);
        change2(birthDate);
        System.out.println(birthDate);
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
